﻿<Window xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"  x:Class="MaxZhang.EasyEntities.EasyDesigner.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:prop="clr-namespace:MaxZhang.EasyEntities.EasyDesigner.Properties"
         
        Title="EasyEntities ORM Desginer" Height="600" Width="800" xmlns:my="clr-namespace:AvalonDock;assembly=AvalonDock" WindowState="Maximized" WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow" Loaded="Window_Loaded" AllowDrop="True" >
    <Window.Resources>
   

        <Style TargetType="{x:Type TreeViewItem}">
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Height="30" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
                            <Image Name="img" Width="28"  Height="28" Stretch="Fill"
                                Source="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TreeViewItem}}, Path=Tag}"/>
                            <TextBlock Text="{Binding}" VerticalAlignment="Center" />
                            
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <!--<i:Interaction.Behaviors>
        <MahApps_Metro_Behaviours:BorderlessWindowBehavior/>
    </i:Interaction.Behaviors>-->
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="23"/>
            <RowDefinition Height="0"/>
            <RowDefinition Height="0"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Menu Grid.Row="0" Foreground="White" Background="#FF2E2A2A" Height="23" FontSize="12">
            <MenuItem Header="文件">
                <MenuItem Header="新建" Click="MenuItem_New_Click"></MenuItem>
                
                <MenuItem Header="从数据库更新" Click="MenuItem_Open_Click"></MenuItem>
                <MenuItem Header="过滤没主键表" Click="MenuItem_Filter_Click" IsCheckable="true">
                
                </MenuItem>
                <MenuItem Header="过滤未配置表" Click="MenuItem_FilterNoCfg_Click" IsCheckable="true"></MenuItem>
                <MenuItem Header="打开" Click="MenuItem_OpenFile_Click"></MenuItem>
                <MenuItem Header="保存" Click="MenuItem_Save_Click"></MenuItem>
              
                <MenuItem Header="导出"></MenuItem>
            </MenuItem>
            <MenuItem Header="编辑"></MenuItem>
            <MenuItem Header="视图"></MenuItem>
            <MenuItem Header="模型"></MenuItem>
            <MenuItem Header="数据库"></MenuItem>
            <MenuItem Header="工具"></MenuItem>
            <MenuItem Header="帮助"></MenuItem>
        </Menu>
        <Grid Grid.Row="1" Background="Black">
       
        </Grid>
       
        <my:DockingManager x:Name="dockManager" Grid.Row="3" Background="#FF2F2F2F" Foreground="White">
            <my:ResizingPanel>
                <my:ResizingPanel my:ResizingPanel.ResizeWidth="270" x:Name="left" >
                    <my:DockablePane BorderBrush="White" BorderThickness="1.5" FontSize="12">

                        <my:DockableContent Title="模型" Selector.IsSelected="True" BorderThickness="1.5"  IsCloseable="False" Focusable="True" IsEnabled="True" IsTabStop="True">
                            <TreeView x:Name="tvWS" Margin="0,2,0,0"   BorderThickness="0"  >
                                <TreeView.ContextMenu>
                                    <ContextMenu Style="{StaticResource MyContextMenu}"  Foreground="Black">
                                        <MenuItem Header="设计" Click="MenuItem_Click"  />
                                    </ContextMenu>
                                </TreeView.ContextMenu>
                                <TreeViewItem Header="工作区" Visibility="Hidden" x:Name="WorkspaceNode"  Foreground="White" IsExpanded="True" Tag="/MaxZhang.EasyEntities.EasyDesigner;component/Images/0202_InsertShape_32.png">
                                    <TreeViewItem Header="物理表实体"  x:Name="DbEntityNode" Foreground="White" Tag="/MaxZhang.EasyEntities.EasyDesigner;component/Images/base_cylinder_32.png" >
                                        <TreeViewItem.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Height="30"  Orientation="Horizontal">
                                                    <Image Width="24" Height="24" Source="/MaxZhang.EasyEntities.EasyDesigner;component/Images/Table_32.png"/>
                                                    <StackPanel Height="30">
                                                        <TextBlock Foreground="WhiteSmoke" Text="{Binding Memo}" />
                                                        <TextBlock Foreground="WhiteSmoke" Text="{Binding Name}"/>
                                                    </StackPanel>
                                                  
                                                  
                                                </StackPanel>
                                            </DataTemplate>
                                        </TreeViewItem.ItemTemplate>
                                    </TreeViewItem>
                                    <TreeViewItem Header="自定义实体"  x:Name="CustomEntityNode" Foreground="White" Tag="/MaxZhang.EasyEntities.EasyDesigner;component/Images/cab.ico" />
                                </TreeViewItem>

                            </TreeView>
                        </my:DockableContent>
                        <my:DockableContent Title="数据库"  Selector.IsSelected="False" BorderThickness="1.5" IsCloseable="False" >
                            <TreeView Margin="0,2,0,0"   BorderThickness="0"  ></TreeView>
                        </my:DockableContent>
                    </my:DockablePane>

                </my:ResizingPanel>

                <my:ResizingPanel x:Name="main"  Orientation="Vertical" >

                <my:ResizingPanel  x:Name="top">
                  
                    <my:DocumentPane x:Name="ContentControl" BorderThickness="1.5" FontSize="12">
                            <my:DocumentContent Height="22" Title="首页" BorderThickness="0" IsCloseable="False">
                                <Grid x:Name="right" ></Grid>
                        </my:DocumentContent>
                    </my:DocumentPane>
                 
                       
                  
                 
                </my:ResizingPanel>
                <my:ResizingPanel x:Name="bottom" my:ResizingPanel.ResizeHeight="0.35*">
                    <my:DockablePane SelectedIndex="0">
                         <my:DockableContent Title="生成" Height="22" FontSize="12">
                                <avalonedit:TextEditor x:Name="editer"  Foreground="Black"	FontFamily="Consolas"
				                        FontSize="10pt"
				                        SyntaxHighlighting="C#"
			                        >
                                </avalonedit:TextEditor>
                            </my:DockableContent>
                            <my:DockableContent Title="日志" Height="22" FontSize="12">
                                wefwefwef
                            </my:DockableContent>
                            <my:DockableContent Title="查询结果" Height="22" FontSize="12">
                                wefwefwef
                            </my:DockableContent>
                        </my:DockablePane>
                    
                </my:ResizingPanel>
                </my:ResizingPanel>
          </my:ResizingPanel>
        </my:DockingManager>


    </Grid>
</Window>
